package pl.edu.agh.neuraleconomy.core.simulation;

import lombok.Data;
import lombok.EqualsAndHashCode;
import pl.edu.agh.neuraleconomy.model.exchange.Company;
import pl.edu.agh.neuraleconomy.model.simulation.Simulation;

@Data
@EqualsAndHashCode(callSuper = true)
public class Share extends pl.edu.agh.neuraleconomy.model.simulation.Share{
	
	public Share(pl.edu.agh.neuraleconomy.model.simulation.Share share){
		super(share.getCompany(), share.getAmount(), share.getSimulation());
		setId(share.getId());
	}
	
	public Share(Company company, int amount, Simulation simualtion){
		super(company, amount, simualtion);
	}
	
	public void addShares(int amount){
		this.amount += amount;
	}
	
	public void removeShares(int amount){
		this.addShares(-amount);
	}
}
